<template>
	<view class="page">
		<view class="flex benben-position-layout flex flex-wrap align-center wrongQuestion_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub wrongQuestion_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  wrongQuestion_fd0_0_c0_c0'>&#xE794;</text>
				</view>
				<text class='wrongQuestion_fd0_0_c1'>章节选择</text>
				<view class='flex flex-wrap align-center wrongQuestion_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<!---flex布局flex布局开始-->
		<!-- <view class="flex flex-direction flex-wrap align-center benben-flex-layout wrongQuestion_flex_1">
			<view class='flex flex-direction flex-wrap align-center justify-center wrongQuestion_fd1_0'>
				<text class='wrongQuestion_fd1_0_c0'>{{mistake_num}}</text>
				<text class='wrongQuestion_fd1_0_c1'>错题数</text>
			</view>
			<view class='flex flex-wrap align-center wrongQuestion_fd1_1'>
				<image class='wrongQuestion_fd1_1_c0' mode="aspectFit" :src='STATIC_URL+"26.png"'></image>
				<image @tap="statusTopic" class='wrongQuestion_fd1_1_c1' mode="aspectFit" :src='STATIC_URL+"27.png"'></image>
			</view>
		</view> -->
		<!---flex布局flex布局结束-->
		<!---flex布局flex布局开始-->
		<!-- <view class="flex benben-flex-layout flex-wrap align-center wrongQuestion_flex_2">
			<image class='wrongQuestion_fd2_0' mode="aspectFit" :src='STATIC_URL+"29.png"'></image>
			<text class='wrongQuestion_fd2_1'>章节错题</text>
			<view class='flex flex-wrap align-center wrongQuestion_fd2_2' @tap.stop="popupShow1658979910882=true">
				<image class='wrongQuestion_fd2_2_c0' mode="aspectFit" :src='STATIC_URL+"28.png"'></image>
				<text class='wrongQuestion_fd2_2_c1'>清空</text>
			</view>
		</view> -->
		<!---flex布局flex布局结束-->
		<!---章节目录flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
			<template v-for='(item,key0) in dataList'>
				<view class='flex flex-direction flex-wrap align-stretch' :key='key0'>
					<view class='flex flex-wrap align-center flex-sub wrongQuestion_fd3_0_c0'>
						<image class='wrongQuestion_fd3_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"30.png"'></image>
						<text class='flex-sub wrongQuestion_fd3_0_c0_c1'>{{item.subject_name}}</text>
					</view>
					<template v-if="item.chapter_list">
						<view class="" v-for="(v, k) in item.chapter_list" :key="k">
							<view v-if="!v.isOpen" @tap.stop="getOpen(key0, k)"
								class="flex not an flex align-center wrongQuestion_notAnfd3_0_c1_c0">
								<view class='flex flex align-center justify-center flex-sub'>
									<image class='wrongQuestion_notAnfd3_0_c1_c0_c0_c0' mode="aspectFit"
										:src='STATIC_URL+"77.png"'>
									</image>
									<text
										class='flex-sub wrongQuestion_notAnfd3_0_c1_c0_c0_c1'>{{v.chapter_name}}</text>
									<text class='wrongQuestion_notAnfd3_0_c1_c0_c0_c2'>{{v.mistakes_num}}</text>
								</view>
							</view>
							<view v-if="v.isOpen" class="flex an flex align-center wrongQuestion_anfd3_0_c1_c0"
								 @tap.stop="getOpen(key0, k)">
												
								<view class='flex flex align-center justify-center flex-sub'>
									<image class='wrongQuestion_anfd3_0_c1_c0_c0_c0' mode="aspectFit"
										:src='STATIC_URL+"22.png"'>
									</image>
									<text class='flex-sub wrongQuestion_anfd3_0_c1_c0_c0_c1'>{{v.chapter_name}}</text>
									<text class='wrongQuestion_anfd3_0_c1_c0_c0_c2'>{{v.mistakes_num}}</text>
								</view>
							</view>
							<view class='flex flex-direction flex-wrap align-stretch chapterSelection_areafd1_0_c0_c0_x' v-if="v.isOpen">
								<view
									class='flex flex-wrap align-center chapterSelection_areafd1_0_c0_c0_c0_c0'>
									<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
										<view class='flex flex-wrap align-center'>
											<text
												class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c0'>{{v.already_do_num}}</text>
											<text
												class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c1'>/</text>
											<text
												class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c2'>{{v.total_num}}</text>
											<text
												class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c3'>题</text>
											<text style="margin-left: 24rpx;">{{v.ratio}}</text>
										</view>
									</view>
								</view>
								<view class='flex benben-progress-bar chapterSelection_areafd1_0_c0_c0_c0_c1'>
									<u-line-progress inactive-color="#f2f2f2" active-color="#1593ff" height="16" :percent="(v.already_do_num / v.total_num)*100"></u-line-progress>
								</view>
							</view>
							<view class="flex line "></view>
							<block v-if="v.isOpen">
								<view class="area wrongQuestion_areafd3_0_c1_c0" v-for="(v1, k1) in v.section_list" :key="k1">
									<view @tap.stop="handleJumpDiy" data-type="navigateTo"
											:data-url="`/pages/my/skimmingChapter/recordDetails?section_id=${v1.sectionmanage_id}&type=${'1'}`"
										class='flex flex-wrap align-center chapterSelection_areafd1_0_c0_c0_c0_c0'>
										<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
											<view
												class='flex flex-wrap align-center chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c0'>
												<text
													class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c0_c0'>{{v1.section_name}}</text>
											</view>
											<view class='flex flex-wrap align-center'>
												<text
													class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c0'>{{v1.already_do_num}}</text>
												<text
													class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c1'>/</text>
												<text
													class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c2'>{{v1.total_num}}</text>
												<text
													class='chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c3'>题</text>
												<text style="margin-left: 24rpx;">{{v1.ratio}}</text>
											</view>
										</view>
										<text
											class='fu-iconfont2  skimmingChapter_areafd1_0_c1_c0_c0_c0_c1'>&#xe7f2;</text>
										<!-- <button class='chapterSelection_areafd1_0_c0_c0_c0_c0_c1'
											@tap.stop="handleJumpDiy" data-type="navigateTo"
											:data-url="`/pages/index/accountingOverview/accountingOverview?section_id=${v.section_id}`">练习</button> -->
									</view>
									<view class='flex benben-progress-bar chapterSelection_areafd1_0_c0_c0_c0_c1'>
										<u-line-progress inactive-color="#f2f2f2" active-color="#1593ff" height="16" :percent="(v1.already_do_num / v1.total_num)*100"></u-line-progress>
													
									</view>
								</view>
							</block>
						</view>
					</template>
				</view>
			</template>

			<benben-empty v-if="dataList.length == 0">
				<view class='flex flex-direction flex-wrap align-center wrongQuestion_fd3_1'>
					<image class='wrongQuestion_fd3_1_c0' mode="widthFix" :src='STATIC_URL+"78.png"'></image>
					<text class='wrongQuestion_fd3_1_c1'>暂无数据</text>

				</view>
			</benben-empty>
		</view>
		<!---章节目录flex布局结束-->
		<benben-popup v-model="popupShow1658979910882" :mask="true" mode='center'>
			<!---清空弹窗flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout wrongQuestion_flex_4">
				<text class='wrongQuestion_fd4_0'>清空错题本</text>
				<text class='wrongQuestion_fd4_1'>确定清空错题本全部错题吗？</text>
				<view class='flex flex-wrap align-center'>
					<button class='wrongQuestion_fd4_2_c0' @tap.stop="popupShow1658979910882=false">取消</button>
					<button class='wrongQuestion_fd4_2_c1' @tap.stop="getclose()">确认</button>
				</view>
			</view>
			<!---清空弹窗flex布局结束-->
		</benben-popup>

	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				"popupShow1658979910882": false,
				"classList": [],
				"mistake_num": 0,
				"dataList": [],
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			this.getclassList()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取错题列表
			async getclassList() {
				//请求方法
				//数据验证

				let classListData = await this.$api.post(global.apiUrls.post63187feb5fc70, {

				});
				if (classListData.data.code != 1) {
					this.$message.info(classListData.data.msg);
					return
				}
				let classListinfo = classListData.data;
				this.dataList = classListData.data.data;
				if(this.dataList.length > 0) {
					this.dataList.forEach((v, k) => {
						if (v.chapter_list.length > 0) {
							v.chapter_list.forEach((v1, k1) => {
								v1.isOpen = false;
							})
						}
					})
				}
				console.log(this.dataList);
			},
			//清空
			async getclose() {
				//请求方法
				//数据验证

				let orwData = await this.$api.post(global.apiUrls.post63072591c072d, {

				});
				if (orwData.data.code != 1) {
					this.popupShow1658979910882 = false;
					this.$message.info(orwData.data.msg);
					return
				}
				let orwinfo = orwData.data;

				this.popupShow1658979910882 = false;
				this.getclassList()
			},
			// 展开和折叠
			getOpen(k, k1) {
				this.dataList[k].chapter_list[k1].isOpen = !this.dataList[k].chapter_list[k1].isOpen;
				this.$forceUpdate();
			},
			// 错题详情
			getAnalysis(sectionmanage_id) {
				uni.navigateTo({
					url: '/pages/index/analysis/analysis?section_id=' + sectionmanage_id + '&type=1'
				})
			},
			
			statusTopic() {
				if (this.dataList.length == 0) {
					this.$message.info('暂无错题记录');
					return;
				}
				let sectionmanage_id = '';
				sectionmanage_id = this.dataList[0].chapter_list[0].section_list[0].sectionmanage_id;
				uni.navigateTo({
					url: '/pages/index/analysis/analysis?section_id=' + sectionmanage_id + '&type=1'
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.skimmingChapter_areafd1_0_c1_c0_c0_c0_c1 {
		font-size: 26rpx;
		color: #999;
	}
	/deep/.u-progress {
		display: block !important;
	}
	
	/deep/.u-active {
		color: transparent !important;
	}
	.chapterSelection_areafd1_0_c0_c0_x {
		padding-top: 32rpx;
		margin: 0 32rpx;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0 {
		margin: 0rpx 0rpx 24rpx 0rpx;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c0 {
		margin: 0rpx 0rpx 24rpx 0rpx;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c0_c0 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c0 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: rgba(21, 147, 255, 1);
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c2 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0_c0_c1_c3 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c0_c1 {
		background: rgba(21, 147, 255, 1);
		background-size: 100% !important;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 26rpx;
		color: #fff;
		margin: 0rpx 0rpx 0rpx auto;
		width: 140rpx;
		height: 56rpx;
		line-height: 56rpx;
	}
	
	.chapterSelection_areafd1_0_c0_c0_c0_c1 {
		background: rgba(242, 242, 242, 1);
		background-size: 100% !important;
		width: 602rpx;
		height: 16rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		background-size: 100% auto !important;
	}
	.wrongQuestion_fd4_0 {
		text-align: center;
		line-height: 50rpx;
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		margin: 40rpx 0rpx 40rpx 0rpx;
	}

	.wrongQuestion_fd4_1 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
		text-align: center;
		margin: 0rpx 0rpx 48rpx 0rpx;
	}

	.wrongQuestion_fd4_2_c0 {
		border-top: 1px solid #eee;
		border-right: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: rgba(153, 153, 153, 1);
		width: 300rpx;
		height: 101rpx;
		line-height: 101rpx;
		font-weight: 500;
	}

	.wrongQuestion_fd4_2_c1 {
		border-top: 1px solid #eee;
		border-left: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: rgba(211, 42, 41, 1);
		width: 300rpx;
		height: 101rpx;
		line-height: 101rpx;
		font-weight: 500;
	}

	.wrongQuestion_flex_4 {
		background: #fff;
		background-size: 100% !important;
		width: 600rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.wrongQuestion_fd3_0_c0 {
		padding: 32rpx 32rpx 24rpx 32rpx;
	}

	.wrongQuestion_fd3_0_c0_c0 {
		width: 36rpx;
		height: 36rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.wrongQuestion_fd3_0_c0_c1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 700;
		color: #333333;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.wrongQuestion_notAnfd3_0_c1_c0 {
		background: rgba(244, 250, 255, 1);
		background-size: 100% !important;
		width: 750rpx;
		height: 80rpx;
		border-radius: 40rpx 40rpx 40rpx 40rpx;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.wrongQuestion_anfd3_0_c1_c0 {
		background: rgba(244, 250, 255, 1);
		background-size: 100% !important;
		border-radius: 40rpx 40rpx 40rpx 40rpx;
		padding: 0rpx 32rpx 0rpx 32rpx;
		width: 750rpx;
		height: 80rpx;
	}

	.wrongQuestion_areafd3_0_c1_c0 {
		min-height: 104rpx;
		padding: 32rpx 32rpx 0rpx 32rpx;
	}

	.wrongQuestion_notAnfd3_0_c1_c0_c0_c0 {
		width: 36rpx;
		height: 36rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.wrongQuestion_notAnfd3_0_c1_c0_c0_c1 {
		font-weight: 700;
		font-size: 32rpx;
		color: #1593FF;
		line-height: 45rpx;
		text-decoration: none;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.wrongQuestion_notAnfd3_0_c1_c0_c0_c2 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #1593FF;
	}

	.wrongQuestion_anfd3_0_c1_c0_c0_c0 {
		width: 36rpx;
		height: 36rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.wrongQuestion_anfd3_0_c1_c0_c0_c1 {
		font-weight: 700;
		font-size: 32rpx;
		color: #1593FF;
		line-height: 45rpx;
		text-decoration: none;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.wrongQuestion_anfd3_0_c1_c0_c0_c2 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #1593FF;
	}

	.wrongQuestion_areafd3_0_c1_c0_c0 {
		border-bottom: 1px solid #eee;
	}

	.wrongQuestion_areafd3_0_c1_c0_c0_c0 {
		height: 100%;
		padding: 0rpx 0rpx 0rpx 55rpx;
	}

	.wrongQuestion_areafd3_0_c1_c0_c0_c0_c0 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}

	.wrongQuestion_areafd3_0_c1_c0_c0_c0_c1 {
		line-height: 40rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #999999;
	}

	.wrongQuestion_areafd3_0_c1_c0_c0_c0_c2 {
		margin: 0rpx 0rpx 0rpx 16rpx;
		color: rgba(153, 153, 153, 1);
		font-size: 26rpx;
	}

	.wrongQuestion_fd3_1 {
		width: 100%;
		padding: 50rpx 0rpx 50rpx 0rpx;
		margin: 32rpx 0rpx 0rpx 0rpx !important;
	}

	.wrongQuestion_fd3_1_c0 {
		width: 400rpx;
		margin: 32rpx 0rpx 0rpx 0rpx !important;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.wrongQuestion_fd3_1_c1 {
		padding: 30rpx 0rpx 0rpx 0rpx;
		color: #929292;
	}

	.wrongQuestion_fd2_0 {
		width: 32rpx;
		height: 20rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.wrongQuestion_fd2_1 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
	}

	.wrongQuestion_fd2_2 {
		margin: 0rpx 0rpx 0rpx auto;
	}

	.wrongQuestion_fd2_2_c0 {
		width: 24rpx;
		height: 28rpx;
		margin: 0rpx 8rpx 0rpx auto;
	}

	.wrongQuestion_fd2_2_c1 {
		font-size: 26rpx;
		font-weight: 500;
		color: #999999;
	}

	.wrongQuestion_flex_2 {
		border-bottom: 1px solid #eee;
		margin: 0rpx 32rpx 0rpx 32rpx;
		height: 93rpx;
	}

	.wrongQuestion_fd1_0 {
		background: url(https://app.ezsdcsm.com/images/25.png) no-repeat, transparent;
		background-size: 100% !important;
		width: 240rpx;
		height: 240rpx;
		background-size: 100% auto !important;
		margin: 48rpx 0rpx 56rpx 0rpx;
	}

	.wrongQuestion_fd1_0_c0 {
		line-height: 67rpx;
		font-size: 56rpx;
		font-weight: 700;
		color: #1593FF;
	}

	.wrongQuestion_fd1_0_c1 {
		line-height: 33rpx;
		font-size: 24rpx;
		font-weight: 500;
		color: #666666;
		margin: 10rpx 0rpx 0rpx 0rpx;
	}

	.wrongQuestion_fd1_1 {
		margin: 0rpx 0rpx 64rpx 0rpx;
	}

	.wrongQuestion_fd1_1_c0 {
		width: 246rpx;
		height: 72rpx;
		border-radius: 36rpx 36rpx 36rpx 36rpx;
		margin: 0rpx 76rpx 0rpx 0rpx;
	}

	.wrongQuestion_fd1_1_c1 {
		width: 246rpx;
		height: 72rpx;
		border-radius: 36rpx 36rpx 36rpx 36rpx;
	}

	.wrongQuestion_flex_1 {
		background: url(https://app.ezsdcsm.com/images/24.png) no-repeat, transparent;
		background-size: 100% !important;
		background-size: 100% auto !important;
		margin: 10rpx 20rpx 0rpx 20rpx;
	}

	.wrongQuestion_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.wrongQuestion_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 36rpx;
	}

	.wrongQuestion_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
		line-height: 50rpx;
	}

	.wrongQuestion_fd0_0_c2 {
		width: 36rpx;
		height: 36rpx;
	}

	.wrongQuestion_flex_0 {
		// background: url(https://app.ezsdcsm.com/images/23.png) no-repeat, transparent;
		background-size: 100% !important;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		// background: url(https://app.ezsdcsm.com/images/23.png) no-repeat, #fff;
		background-size: 100% auto !important;
	}
</style>
